<%@ page language="java" contentType="text/html; charset=UTF-8"
    import="java.util.*,java.sql.*,kk.*" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<link href="css/read.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function checkComment(){
		var cauthor = document.getElementById("cauthor");
		var content = document.getElementById("ccontent");
		if(cauthor.value == ""){
			alert("用户名不能为空！！");
			return false;
		}else if(content.value == ""){
			alert("评论内容不能为空！！");
			return false;
		}
		return true;
	}
</script>
</head>


<div id="container">
  


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<div class="sidebar">
    <h1> <img src="images/title_1.gif" alt="国内新闻" /> </h1>
    <div class="side_list">
      <ul>      
       		<%
                NewsDao ndao1=new NewsDao();
                List<News> l2=ndao1.findTop(1L);
                //System.out.print(l); 
              	for(News n3:l2){
       		 %>
       		 <li> <a href='ReadNew?nid=<%=n3.getNid()%>'><b><%=n3.getNtitle()%></b></a> </li>
       		 <%}%>
      </ul>
    </div>
    <h1> <img src="images/title_2.gif" alt="国际新闻" /> </h1>
    <div class="side_list">
      <ul>    
      		<%
                NewsDao ndao2=new NewsDao();
                List<News> l3=ndao2.findTop(2L);
                //System.out.print(l); 
              	for(News n3:l3){
       		 %>
       		 <li> <a href='ReadNew?nid=<%=n3.getNid()%>'><b><%=n3.getNtitle()%></b></a> </li>
       		 <%}%>  
      </ul>
    </div>
    <h1> <img src="images/title_3.gif" alt="娱乐新闻" /> </h1>
    <div class="side_list">
      <ul>
            <%
                NewsDao ndao3=new NewsDao();
                List<News> l4=ndao3.findTop(5L);
                //System.out.print(l); 
              	for(News n3:l4){
       		 %>
       		 <li> <a href='ReadNew?nid=<%=n3.getNid()%>'><b><%=n3.getNtitle()%></b></a> </li>
       		 <%}%>
      </ul>
    </div>
  </div>

<%--<%
NewsDao n=new NewsDao();
String id=request.getParameter("nid");
Long nid=Long.parseLong(id);
News n1=n.get(nid);
 %>--%>

  <div class="main">
    <div class="class_type"> <img src="images/class_type.gif" alt="新闻中心" /> </div>
    <div class="content">
      <ul class="classlist">
        <table width="80%" align="center">
          <tr width="100%">
            <td colspan="2" align="center">${n1.ntitle}</td>
          </tr>
          <tr>
            <td colspan="2"><hr />
            </td>
          </tr>
          <tr>
            <td align="center">作者：${n1.nauthor}                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             </a></td>
            <td align="left">发布时间：${n1.ncreatedate}</td>
          </tr>          
          <tr>
            <td colspan="2" align="center"></td>
          </tr>
          <tr>
            <td colspan="2">    ${n1.ncontent}
</td>
          </tr>
          <tr>
            <td colspan="2"><hr />
            </td>
          </tr>
        </table>
      </ul>
      <ul class="classlist">
        <table width="80%" align="center">
        
        	<td colspan="6"> <%--<%
        	CommentDao cdao=new CommentDao();
        	List<Comment> l=cdao.findComments(nid);
        	for(Comment c:l){%>
        	<div><%=c.getCcontent()%><%=c.getCauthor()%><%=c.getCip()%><%=c.getCdate()%></div>
        	<%}%>--%>
        	  </td>
	          <tr>
	            <td colspan="6"><hr />
	            </td>
	          </tr>
                
          
        </table>
        <%--<img src='images/left.jpg'/>--%>
        <img src='${n1.npicpath}'/>
      </ul>
      <ul class="classlist">
        <form action="news_control.jsp?opr=addComment&nid=${n1.nid}" method="post" onSubmit="return checkComment()">
          <table width="80%" align="center">
            <tr>
              <td> 评 论</td>
               <c:forEach var="l" items="${requestScope.l}" varStatus="status">
                	<td>${l.ccontent}${l.cdate}${l.cauthor}${l.cip}</td>
                </c:forEach>
            </tr>
            <tr>
              <td> 用户名： </td>
              <td>
              	 
	            
	              <input id="cauthor" name="cauthor" value="这家伙很懒什么也没留下"/>
	            
                IP：
                <input name="cip" id="cip" value="${pageContext.request.remoteAddr}" readonly="readonly" style="border:0px;"/>
              </td>
            </tr>
            <tr>
              <td colspan="2"><textarea name="ccontent" id="ccontent" cols="70" rows="10"></textarea>
              </td>
            </tr>
            <td><input name="submit" value="发  表" type="submit"/>
              </td>
          </table>
        </form>
      </ul>
    </div>
  </div>
</div>

<div id="friend">
  <h1 class="friend_t"> <img src="images/friend_ico.gif" alt="合作伙伴" /> </h1>
  <div class="friend_list">
    <ul>
      <li> <a href="#">百度</a> </li>
      <li> <a href="#">谷歌</a> </li>
      <li> <a href="#">新浪</a> </li>
      <li> <a href="#">网易</a> </li>
      <li> <a href="#">搜狐</a> </li>
      <li> <a href="#">人人</a> </li>
      <li> <a href="#">中国政府网</a> </li>
    </ul>
  </div>
</div>
<div id="footer">
  <p class=""> 24小时客户服务热线：010-68988888 &#160;&#160;&#160;&#160; <a href="#">常见问题解答</a> &#160;&#160;&#160;&#160; 新闻热线：010-627488888 <br />
    文明办网文明上网举报电话：010-627488888 &#160;&#160;&#160;&#160; 举报邮箱： <a href="#">jubao@jb-aptech.com.cn</a> </p>
  <p class="copyright"> Copyright &copy; 1999-2009 News China gov, All Right Reserver <br />
    新闻中国 版权所有 </p>
</div>
</body>
</html>

</html>